"""项目启动文件"""

from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand
from app import create_app, db


app = create_app('development')
# 创建管理类
manager = Manager(app)
# 创建迁移对象
Migrate(app, db)
# 通过管理类添加数据库迁移指令db
manager.add_command('db', MigrateCommand)

"""
终端执行命令:
python manage.py db init
python manage.py db migrate -m "initial"
python manage.py db upgrade
"""

if __name__ == '__main__':
    manager.run()
